<?php
$url=isset($_GET['url'])?$_GET['url']:'';
?>
<?php if(!empty($url)):?>
    <div class="btn-group"><a href="<?php echo $url; ?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>
<?php else:?>
    <div class="btn-group"><a href="<?php echo site_url('user/index');?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>
<?php endif;?>
<?php include_once 'inc_form_errors.php'; ?>

<div class="boxed">
    <h3> <i class="fa fa-plus"></i> <span class="badge badge-success pull-right"><?php echo $title; ?></span> <?php echo lang('add') ?></h3>
    <?php echo form_open(current_url(),array("class"=>"form-horizontal","id"=>"frm-create")); ?>

    <div class="boxed-inner seamless">

        <div class="control-group">
            <label for="title" class="control-label">ID：</label>
            <div class="controls"><?php echo $it['id']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">手机号码：</label>
            <div class="controls"><?php echo $it['phone']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">用户名：</label>
            <div class="controls"><?php echo $it['uname']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">email：</label>
            <div class="controls"><?php echo $it['email']; ?></div>
        </div>
        <div class="control-group">
            <label for="title" class="control-label">性别：</label>
            <div class="controls">
               <?php
                    switch($it['sex']){
                        case 1:echo "男";break;
                        case 2:echo "女";break;
                        default:echo "";break;
                    }
               ?>
            </div>
        </div>
        <?php if(!empty($it['position'])) {?>
            <div class="control-group">
                <label for="title" class="control-label">职位：</label>
                <div class="controls"><?php echo $it['position']; ?></div>
            </div>
        <?php } ?>
        <div class="control-group">
            <label for="title" class="control-label">注册时间：</label>
            <div class="controls">
                <?php echo date("Y-m-d H:i:s",$it['timeline']); ?>
            </div>
        </div>
        <div class="clear"></div>

    </div>

<!--    <div class="boxed-footer">-->
<!--        <input type="hidden" name="id" value="--><?php //echo $it['id'] ?><!--">-->
<!--        <input type="submit" value=" --><?php //echo lang('submit'); ?><!-- " class='btn btn-primary'>-->
<!--        <input type="reset" value=' --><?php //echo lang('reset'); ?><!-- ' class="btn btn-danger">-->
<!--    </div>-->
    </form>
</div>

<?php include_once 'inc_ui_media.php'; ?>

<script type="text/javascript">
    require(['adminer/js/ui','adminer/js/media','bootstrap-datetimepicker.zh'],function(ui,media){
        // timepick
        $('.timepicker').datetimepicker({'language':'zh-CN','format':'yyyy/mm/dd hh:ii:ss','todayHighlight':true});
        // ueditor处理
        ui.editor_create('content');

        // media 上传
        media.init();
        var articles_photos = <?php echo json_encode(one_upload(set_value("photo"))) ?>;
        media.show(articles_photos,"photo");
    });

</script>
